#-----------------------------------------------------------------------------
# File Name: makefile
# Description
# -----------
# This is the makefile for the AESCDriver project.
#
#-----------------------------------------------------------------------------
SHELL 		= /bin/sh
EXECUTABLES	= AESCDriver

#-- Release Compiler Flags ---------------------------------------------------

CXXFLAGS		+= -O2 -g0 -Wall -fno-strict-aliasing -Wno-write-strings -pipe -fomit-frame-pointer -D_GNU_SOURCE

#-- Required libraries -------------------------------------------------------

LIBS		 	 = -lrt -lftdi -lstdc++

#-- Dependencies -------------------------------------------------------------

AESC_DRIVER_OBJS = LinuxMain.o DriverFuncs.o Config.o ../FtdiAccess.o ../FtdiMilan.o
AESC_DRIVER_DEPS = DriverFuncs.h ../Ftdi.h ../../Configuration.h

#-- Compile All --------------------------------------------------------------

.PHONEY: all
all: 	$(EXECUTABLES)

#-- Clean Up -----------------------------------------------------------------

.PHONEY: clean
clean:
	rm -f ../FtdiAccess.o ../FtdiMilan.o
	rm -f *.[bo]
	rm -f *.err
	rm -f $(EXECUTABLES)

#-- Install ------------------------------------------------------------------

.PHONEY: install
install:

	cp -fv $(EXECUTABLES) /usr/local/bin/

#-- Build targets ------------------------------------------------------------

AESCDriver:	$(AESC_DRIVER_OBJS)
		$(CC) $(AESC_DRIVER_OBJS) $(CFLAGS) $(LIBS) -o AESCDriver

#-- Check on headers ---------------------------------------------------------

AESCDriver.o: $(AESC_DRIVER_DEPS)

#------------------------------ END OF FILE ----------------------------------

